﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace MyTcpIp.displacement
{
    /// <summary>
    /// 通道位移数据包
    /// </summary>
    [StructLayoutAttribute(LayoutKind.Sequential, Pack = 4)]
    public struct CHDisplacementData
    {
        /// <summary>
        /// 通道ID
        /// </summary>
        public UInt16 ChID;

        //float DisplayBuffer;
        /// <summary>
        /// 峰峰值
        /// </summary>        
        public float PK2PK;

        /// <summary>
        /// 间隙电压
        /// </summary>                                 
        public float GapVoltage;

        /// <summary>
        /// FFT幅值 512
        /// </summary>            
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)]
        public float[] Amps;

        /// <summary>
        /// FFT相位512
        /// </summary>                
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)]
        public float[] Phs;

        /// <summary>
        /// 原始数据1024
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)]
        public float[] ZDs;

        /// <summary>
        /// 平方根值
        /// </summary>                                     
        public float RoomSquareValue;

        /// <summary>
        /// 一倍频幅值
        /// </summary>        	
        public float OneMultiplierAmp;

        /// <summary>
        /// 一倍频相位
        /// </summary>        	                     
        public float OneMultiplierPhase;

        /// <summary>
        /// 二倍频幅值
        /// </summary>
        public float TWOMultiplierAmp;

        /// <summary>
        /// 二倍频相位
        /// </summary>                              
        public float TWOMultiplierPhase;

        /// <summary>
        /// 半频幅值 
        /// </summary>                        
        public float HalfMultiplierAmp;

        /// <summary>
        /// 半频相位
        /// </summary>                    
        public float HaltMultiplierPhase;

        /// <summary>
        /// 可选频段1 
        /// </summary>                         
        public float FreOption1;

        /// <summary>
        /// 可选频段2
        /// </summary>                        
        public float FreOption2;

        /// <summary>
        /// 可选频段3 
        /// </summary>                                 
        public float FreOption3;

        /// <summary>
        /// 报警标志
        /// </summary>         
        public byte AlarmFlag;
    }
}
